Skip to content

fix(web): prevent Plausible SSR crash#107

Merged
devakone merged 1 commit into
developfrom
codex/fix-plausible-ssr-sentry
Jun 21, 2026
Merged

fix(web): prevent Plausible SSR crash#107
devakone merged 1 commit into
developfrom
codex/fix-plausible-ssr-sentry

Conversation

@devakone

Copy link
Copy Markdown
Owner

Summary

  • load the browser-only Plausible tracker dynamically to prevent location is not defined during SSR
  • preserve initial and route-change pageview tracking after async initialization
  • rename the Sentry source-map project target to vibe-coding-profiler
  • add a Node-environment regression test for analytics module imports

Incident

Both production domains returned HTTP 500. The production server reproduced ReferenceError: location is not defined because @plausible-analytics/tracker@0.4.4 reads location.href at module evaluation time. Sentry had no issues because the crash occurred before Sentry initialized.

Validation

  • vitest run: 41 tests passed
  • tsc --noEmit: passed
  • focused ESLint: passed
  • next build: passed
  • production server smoke test: / changed from HTTP 500 to HTTP 200

Load the browser-only Plausible tracker dynamically so server rendering no longer evaluates location at module load. Update the renamed Sentry project slug and add an SSR regression test.

Co-Authored-By: Claude <noreply@anthropic.com>
@supabase

supabase Bot commented Jun 21, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project idjewtwnfrufbxoxulmq because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vibe-coding-profiler Ready Ready Preview, Comment Jun 21, 2026 4:06pm

Request Review

@devakone devakone merged commit 9c058cf into develop Jun 21, 2026
7 checks passed
@devakone devakone deleted the codex/fix-plausible-ssr-sentry branch June 21, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant